#include "junix.h"

int main(int argc, char **argv)
{
	int from_fd, to_fd;
	ssize_t sz;
	char buf[BUFSIZ];

	if(argc!=3)
		err_quit("Usage:%s from to", argv[0] );
	from_fd = Open(argv[1], O_RDONLY);
	to_fd=Open(argv[2],O_RDWR|O_TRUNC|O_CREAT, 0644);

	while( (sz=Read(from_fd, buf, BUFSIZ)) >0)
		Write(to_fd, buf,sz);

	Close(from_fd);
	Close(to_fd);

    exit(0);
}

